Type Configuration

	
	Method LoadConfig()
	
		Local Conf : xmlDocument = New xmlDocument
		If FileType("Data/Config.xml") = 0 Then Return
		Conf.Load("Data/Config.xml")
		Local root : xmlNode = Conf.Root()
		If root = Null Return
		Local SettingsNode : xmlNode = root.FindChild("Settings")
		If SettingsNode = Null Return
		Local InfoNode : xmlNode = SettingsNode.FindChild("Project")
		If InfoNode = Null Return
		CurrentProject = InfoNode.Attribute("proj").Value
		AppTitle = "Spaget - "+CurrentProject
	
	End Method
	
	Method SaveConfig()
	
		Local Conf : xmlDocument = New xmlDocument
		Local root : xmlNode = Conf.Root()
		
		Local SettingsNode : xmlNode = root.AddNode("Settings", AS_CHILD)
		
		Local InfoNode : xmlNode = SettingsNode.AddNode("Project", AS_CHILD)
		
		InfoNode.Attribute("proj").Value = CurrentProject
		
		Conf.Save("Data/Config.xml")
		
		
		
	
	End Method
	

End Type
